<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MRGSP.SurveyMaster.Core.Model.IPageable<MRGSP.SurveyMaster.Core.Model.Survey>>" %>

<%@ Import Namespace="MRGSP.SurveyMaster.Localization" %>
<%@ Import Namespace="MRGSP.SurveyMaster.WebUI.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Survey list
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
        Html.RenderPartial("ConfirmDelete"); %>
    <script type="text/javascript">
        $(function () {
            $("#b1").click(function () { window.location = '<%=Url.Action("Create") %>'; });
        });
    </script>
    <button class="fgb" id="b1">
        Create</button>
    <br class="cbt" />
    <br />
    <div class="lgrid">
        <%foreach (var item in Model.Page)
          {%>
        <div class="row">
            <div class="fl cell">
                <%=item.Name %>
            </div>
            <%if (item.Active){%>
                 <div class="fr">
                    <form method="post" action=" <%=Url.Action("Deactivate", new { id = item.Id}) %>">
                    <input type="submit" value='Deactivate' />
                    </form>
                </div>
                <%} %>
            <%if (!item.Active)
              {%>
            <div class="fr">
                <div class="fr">
                    <form method="post" action="<%=Url.Action("Delete") %>">
                    <input type="hidden" name="id" value="<%=item.Id %>" />
                    <input type="submit" class="delete" value='<%=MUI.delete%>' />
                    </form>
                </div>
                <div class="fr">
                    <form action=" <%=Url.Action("EditContent", new { id = item.Id}) %>">
                    <input type="submit" value='<%=MUI.edit_conent%>' />
                    </form>
                </div>
                <div class="fr">
                    <form method="get" action="<%=Url.Action("Edit",new{id = item.Id}) %>">
                    <input type="submit" value="<%=MUI.edit %>" />
                    </form>
                </div>
                <div class="fr">
                    <form method="post" action=" <%=Url.Action("Activate", new { id = item.Id}) %>">
                    <input type="submit" value='Activate' />
                    </form>
                </div>
            </div>
            <%}%>
        </div>
        <%
            }%>
    </div>
    <br class="cbt" />
    <%=Html.Pagination() %>
</asp:Content>
